<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //   Number, String, Boolean

      let str = '哈喽,你好,Ikun哈喽,你好,Ikun'

      //字符串长度
      //   console.log(str.length)

      //将字符串转为数组 参数就是要用哪个字符串分割
      //   console.log(str.split(','))

      //截取字符串
      //   console.log(str.substring(3))

      //   console.log(str.startsWith('哈喽,你好,ikun'))
      //   console.log(str.endsWith('哈喽,你好,ikun'))

      //   console.log(str.toUpperCase())
      //   console.log(str.toLowerCase())

      //   console.log(str.indexOf('ikun'))

      const reg = /你好/

      console.log(reg.exec(str))

      console.log(str.match(reg))
    </script>
  </body>
</html>
